<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Name:  Roles Model
*
* Author:  William Bermudo
*
*/

class Roles_m extends DataMapperExt
{
	public $table = 'roles';
	
	public function __construct($id = NULL)
	{
		parent::__construct($id);
	}
	
	public function get_roles()
	{
		$objRoles = new Roles_m();
		
		$objRoles->where('is_active', '1');
		$objRoles->get();
		
		if ($objRoles->result_count() > 0)
		{
			$result = array('0' => '-- Select Role --');
			foreach ($objRoles as $role)
			{
				$result[$role->id] = $role->name;
			}
			
			return $result;
		}
	}
}